<?php /* Smarty version 2.6.25, created on 2014-08-02 13:54:31
         compiled from content/views/extend.manage-content-ajax.tpl */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'count', 'content/views/extend.manage-content-ajax.tpl', 1, false),array('block', 'p', 'content/views/extend.manage-content-ajax.tpl', 103, false),array('block', 'np', 'content/views/extend.manage-content-ajax.tpl', 125, false),)), $this); ?>
<?php if (count($this->_tpl_vars['allContent']) > 0): ?>
<form method="POST" name="sortForm">
<table>
	<thead>
		<tr>
			<th width="3%"><input class="check-all" type="checkbox" /></th>
			<th width="3%">#</th>
			<th width="10%">Category</th>
			<th width="10%">Created</th>
			<th class="center" width="4%">Sort 
				<?php if ($this->_tpl_vars['fullPermisison']): ?> 
				<a href="javascript:sortContent();">
					<img src="<?php echo $this->_tpl_vars['LAYOUT_HELPER_URL']; ?>
admin/images/icons/save_16.png" alt="Save sorting">
				</a> 
				<?php endif; ?>
<!--				<img src="<?php echo $this->_tpl_vars['LAYOUT_HELPER_URL']; ?>
admin/images/icons/save_16.png" alt="Save sorting">-->
			</th>
			<th width="50%">Title</th>
			<th width="5%">Hit</th>
			<th width="5%">Pub</th>
			<th width="5%">Edit</th>
			<th width="5%">GID/ID</th>
		</tr>

	</thead>

	<tbody>

		<?php $_from = $this->_tpl_vars['allContent']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }$this->_foreach['content'] = array('total' => count($_from), 'iteration' => 0);
if ($this->_foreach['content']['total'] > 0):
    foreach ($_from as $this->_tpl_vars['item']):
        $this->_foreach['content']['iteration']++;
?>
		<tr>
			<td>
				<?php if (1 == $this->_tpl_vars['item']['content_deleteable']): ?>
					<input type="checkbox" value="<?php echo $this->_tpl_vars['item']['content_gid']; ?>
" name="allContent" />
				<?php else: ?>
					<img src="<?php echo $this->_tpl_vars['LAYOUT_HELPER_URL']; ?>
admin/images/icons/unselect.png" alt="Do not delete, enable, disable" />
				<?php endif; ?>
			</td>
			<td><?php echo $this->_foreach['content']['iteration']; ?>
</td>
			<td><?php echo $this->_tpl_vars['item']['cname']; ?>
</td>
			<td><?php echo $this->_tpl_vars['item']['created_date']; ?>
</td>
			<td class="center">
				<?php if ($this->_tpl_vars['fullPermisison']): ?> 
					<input class="sorting" name="data[<?php echo $this->_tpl_vars['item']['content_gid']; ?>
]" value="<?php echo $this->_tpl_vars['item']['sorting']; ?>
" size="3" style="text-align: center;" />
				<?php else: ?>
					<?php echo $this->_tpl_vars['item']['sorting']; ?>
 
				<?php endif; ?>
			</td>

			<td colspan="5" style="padding: 0px;"><!-- All languages -->
			<table style="border-collapse: separate">
				<tbody id="table<?php echo $this->_tpl_vars['item']['content_id']; ?>
">
					<tr>
						<td width="68">--</td>
						<td width="7%"><?php echo $this->_tpl_vars['item']['hit']; ?>
</td>
						<td width="7%">
							<?php if ($this->_tpl_vars['item']['genabled'] == '1'): ?> 
								<?php if ($this->_tpl_vars['fullPermisison'] && 1 == $this->_tpl_vars['item']['content_deleteable']): ?> 
								<a href="javascript:disableAContent(<?php echo $this->_tpl_vars['item']['content_gid']; ?>
);">
									<img src="<?php echo $this->_tpl_vars['LAYOUT_HELPER_URL']; ?>
admin/images/icons/visible16x16.png">
								</a>
								<?php else: ?> 
								<img src="<?php echo $this->_tpl_vars['LAYOUT_HELPER_URL']; ?>
admin/images/icons/visible16x16.png">
								<?php endif; ?> 
							<?php else: ?> 
								<?php if ($this->_tpl_vars['fullPermisison'] && 1 == $this->_tpl_vars['item']['content_deleteable']): ?> 
								<a href="javascript:enableAContent(<?php echo $this->_tpl_vars['item']['content_gid']; ?>
);">
									<img src="<?php echo $this->_tpl_vars['LAYOUT_HELPER_URL']; ?>
admin/images/icons/invisible16x16.png">
								</a>
								<?php else: ?> 
								<img src="<?php echo $this->_tpl_vars['LAYOUT_HELPER_URL']; ?>
admin/images/icons/invisible16x16.png">
								<?php endif; ?> 
							<?php endif; ?>
						</td>
						<td width="10%">
							<?php if ($this->_tpl_vars['fullPermisison']): ?> 
							<?php if (false != $this->_tpl_vars['pid']): ?>
								<a href="javascript:editContent(<?php echo $this->_tpl_vars['pid']; ?>
,<?php echo $this->_tpl_vars['item']['content_gid']; ?>
);" title="Edit Content">
									<img src="<?php echo $this->_tpl_vars['LAYOUT_HELPER_URL']; ?>
admin/images/icons/pencil.png" alt="Edit Content" />
								</a> 
							<?php else: ?>
								<a href="javascript:editContent(null,<?php echo $this->_tpl_vars['item']['content_gid']; ?>
);" title="Edit Content">
									<img src="<?php echo $this->_tpl_vars['LAYOUT_HELPER_URL']; ?>
admin/images/icons/pencil.png" alt="Edit Content" />
								</a> 
							<?php endif; ?>
							
							<?php else: ?> -- <?php endif; ?>
						</td>
						<td width=8%"><?php echo $this->_tpl_vars['item']['content_gid']; ?>
</td>
					</tr>

					<?php $_from = $this->_tpl_vars['item']['langs']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['item2']):
?>
					<tr>
						<td>
							<img style="vertical-align:middle;" src="<?php echo $this->_tpl_vars['BASE_URL']; ?>
<?php echo $this->_tpl_vars['item2']['lang_image']; ?>
"> <?php echo $this->_tpl_vars['item2']['title']; ?>

						</td>
						<td><?php echo $this->_tpl_vars['item2']['hit']; ?>
</td>
						<td>
							<?php $this->assign('langId', $this->_tpl_vars['item2']['lang_id']); ?> 
							
							<?php if ($this->_tpl_vars['item']['genabled'] == '1'): ?> 
							
								<!-- FULL PERMISSION --> 
								<?php $this->_tag_stack[] = array('p', array('name' => 'edit_content','module' => 'content','expandId' => $this->_tpl_vars['langId'])); $_block_repeat=true;Nine_View_Register_Permission::checkPermisison($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?> 
									<?php if ($this->_tpl_vars['item2']['enabled'] == '1'): ?> 
										<?php if (1 == $this->_tpl_vars['item']['content_deleteable']): ?> 
											<a href="javascript:disableAContent(<?php echo $this->_tpl_vars['item']['content_gid']; ?>
,<?php echo $this->_tpl_vars['item2']['lang_id']; ?>
);">
												<img src="<?php echo $this->_tpl_vars['LAYOUT_HELPER_URL']; ?>
admin/images/icons/visible16x16.png">
											</a>
										<?php else: ?> 
											<img src="<?php echo $this->_tpl_vars['LAYOUT_HELPER_URL']; ?>
admin/images/icons/visible16x16.png">
										<?php endif; ?> 
									<?php else: ?> 
										<?php if (1 == $this->_tpl_vars['item']['content_deleteable']): ?> 
											<a href="javascript:enableAContent(<?php echo $this->_tpl_vars['item']['content_gid']; ?>
,<?php echo $this->_tpl_vars['item2']['lang_id']; ?>
);">
												<img src="<?php echo $this->_tpl_vars['LAYOUT_HELPER_URL']; ?>
admin/images/icons/invisible16x16.png">
											</a>
										<?php else: ?> 
											<img src="<?php echo $this->_tpl_vars['LAYOUT_HELPER_URL']; ?>
admin/images/icons/invisible16x16.png">
										<?php endif; ?> 
									<?php endif; ?> 
								<?php $_block_content = ob_get_contents(); ob_end_clean(); $_block_repeat=false;echo Nine_View_Register_Permission::checkPermisison($this->_tag_stack[count($this->_tag_stack)-1][1], $_block_content, $this, $_block_repeat); }  array_pop($this->_tag_stack); ?> 
								
								<!-- DON'T HAVE PERMISSION --> 
								
								<?php $this->_tag_stack[] = array('np', array('name' => 'edit_content','module' => 'content','expandId' => $this->_tpl_vars['langId'])); $_block_repeat=true;Nine_View_Register_Permission::checkNotPermisison($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?> 
									<?php if ($this->_tpl_vars['item2']['enabled'] == '1'): ?> 
										<img src="<?php echo $this->_tpl_vars['LAYOUT_HELPER_URL']; ?>
admin/images/icons/visible16x16.png">
									<?php else: ?> 
										<img src="<?php echo $this->_tpl_vars['LAYOUT_HELPER_URL']; ?>
admin/images/icons/invisible16x16.png">
									<?php endif; ?> 
								<?php $_block_content = ob_get_contents(); ob_end_clean(); $_block_repeat=false;echo Nine_View_Register_Permission::checkNotPermisison($this->_tag_stack[count($this->_tag_stack)-1][1], $_block_content, $this, $_block_repeat); }  array_pop($this->_tag_stack); ?> 
							
							<?php else: ?> 
								<img src="<?php echo $this->_tpl_vars['LAYOUT_HELPER_URL']; ?>
admin/images/icons/invisible16x16.png">
							<?php endif; ?>
						</td>
						<td>
							<?php $this->_tag_stack[] = array('p', array('name' => 'edit_content','module' => 'content','expandId' => $this->_tpl_vars['langId'])); $_block_repeat=true;Nine_View_Register_Permission::checkPermisison($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?> 
								<?php if (false != $this->_tpl_vars['pid']): ?>
									<a href="javascript:editContent(<?php echo $this->_tpl_vars['pid']; ?>
,<?php echo $this->_tpl_vars['item']['content_gid']; ?>
,<?php echo $this->_tpl_vars['item2']['lang_id']; ?>
);" title="Edit Content">
										<img src="<?php echo $this->_tpl_vars['LAYOUT_HELPER_URL']; ?>
admin/images/icons/pencil.png" alt="Edit Content" />
									</a> 
								<?php else: ?>
									<a href="javascript:editContent(null,<?php echo $this->_tpl_vars['item']['content_gid']; ?>
,<?php echo $this->_tpl_vars['item2']['lang_id']; ?>
);" title="Edit Content">
										<img src="<?php echo $this->_tpl_vars['LAYOUT_HELPER_URL']; ?>
admin/images/icons/pencil.png" alt="Edit Content" />
									</a>
								<?php endif; ?>
							<?php $_block_content = ob_get_contents(); ob_end_clean(); $_block_repeat=false;echo Nine_View_Register_Permission::checkPermisison($this->_tag_stack[count($this->_tag_stack)-1][1], $_block_content, $this, $_block_repeat); }  array_pop($this->_tag_stack); ?> 
							
							<?php $this->_tag_stack[] = array('np', array('name' => 'edit_content','module' => 'content','expandId' => $this->_tpl_vars['langId'])); $_block_repeat=true;Nine_View_Register_Permission::checkNotPermisison($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?>
							 -- 
							 <?php $_block_content = ob_get_contents(); ob_end_clean(); $_block_repeat=false;echo Nine_View_Register_Permission::checkNotPermisison($this->_tag_stack[count($this->_tag_stack)-1][1], $_block_content, $this, $_block_repeat); }  array_pop($this->_tag_stack); ?>
						</td>
						<td><?php echo $this->_tpl_vars['item2']['content_id']; ?>
</td>
					</tr>
					<?php endforeach; endif; unset($_from); ?>

				</tbody>
			</table>
			</td>
		</tr>
		<?php endforeach; endif; unset($_from); ?>
	</tbody>
</table>
</form>

<br/>
<!-- CHOOSE ACTION -->
                        <?php $this->_tag_stack[] = array('p', array('name' => 'edit_content','module' => 'content')); $_block_repeat=true;Nine_View_Register_Permission::checkPermisison($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?>
                        <div class="bulk-actions align-left" style="float: left;padding-top: 14px;">
                            <select id="action">
                                <option value=";">Choose an action...</option>
                                <?php $this->_tag_stack[] = array('p', array('name' => 'delete_content','module' => 'content')); $_block_repeat=true;Nine_View_Register_Permission::checkPermisison($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?>
                                <option value="deleteContent();">Delete</option>
                                <?php $_block_content = ob_get_contents(); ob_end_clean(); $_block_repeat=false;echo Nine_View_Register_Permission::checkPermisison($this->_tag_stack[count($this->_tag_stack)-1][1], $_block_content, $this, $_block_repeat); }  array_pop($this->_tag_stack); ?>
                                <option value="enableContent();">Enable</option>
                                <option value="disableContent();">Disable</option>
                            </select>
                            <a class="button" href="javascript:applySelected();">Apply to selected</a>
                        </div>
                        <?php $_block_content = ob_get_contents(); ob_end_clean(); $_block_repeat=false;echo Nine_View_Register_Permission::checkPermisison($this->_tag_stack[count($this->_tag_stack)-1][1], $_block_content, $this, $_block_repeat); }  array_pop($this->_tag_stack); ?>
<div class="clear"></div>
<?php else: ?>

<!-- MESSAGE HERE -->
<div class="notification information png_bg">
	<a href="#" class="close">
		<img src="<?php echo $this->_tpl_vars['LAYOUT_HELPER_URL']; ?>
admin/images/icons/cross_grey_small.png"
		title="Close this notification" alt="close" />
	</a>
	<div>No product content existing.</div>
</div>


<?php endif; ?> 

<p>
	<br />
	<input class="button" type="button" value="New Content" onclick="javascript:newContent(<?php echo $this->_tpl_vars['pid']; ?>
);" />
</p>


<script type="text/javascript">
function newContent(pid)
{
	url = "<?php echo $this->_tpl_vars['APP_BASE_URL']; ?>
content/extend/new-content";
	if (null != pid) {
		url = url + '/pid/' + pid;
	}
	
	window.open( url, "myWindow", "status = 1, width = 1000, scrollbars = 1");
}

function editContent(pid,gid,lid)
{
	var url = "<?php echo $this->_tpl_vars['APP_BASE_URL']; ?>
content/extend/edit-content";
	if (null != pid) {
		url = url + "/pid/" + pid;
	}
	if (null != gid) {
		url = url + "/gid/" + gid;
	}
	if (null != lid) {
		url = url + "/lid/" + lid;
	}

	window.open(url, "myWindow", "status = 1, width = 1000, scrollbars = 1");
}
</script>